﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    //  Layout = null;
}

<script>
    //不知道为什么jqGrid5.1必须写在页面而不能放在organizeManager.js里面？？？？
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            treeGrid: true,
            treeGridModel: "adjacency",
            ExpandColumn: "Name",
            url: "/OrganizeManager/GetTreeGridJson",
            height: $(window).height() - 96,
            colModel: [
                { label: '名称', name: 'Name', width: 200, align: 'left' },
                { label: "主键", name: "Id", hidden: true, key: true },

                { label: '编号', name: 'Code', width: 150, align: 'left' },
                {
                    label: "有效", name: "Status", width: 60, align: "center",
                    formatter: function (cellvalue) {
                        return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
                    }
                }
            ]
        });
        //$("#btn_search").click(function () {
        //    $gridList.jqGrid('setGridParam', {
        //        postData: { keyword: $("#txt_keyword").val() },
        //    }).trigger('reloadGrid');
        //});
    }


</script>

<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
    <div class="row">
        <div class="col-md-12">
                <div class="widget-box">
                    <div class="widget-header">
                        @Html.Action("MenuHeader", "Home")
                    </div>
                    <div class="gridPanel">
                        <table id="gridList"></table>
                    </div>
                </div>
        </div>
    </div>
</div><!-- /.page-content -->
<!--编辑对话框-->
<div id="editDlg" style="display: none">
    <div class="col-xs-12">
        <form class="form-horizontal" id="editForm">
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="Name"> 名称 </label>
                <div class="col-sm-9">
                    <input type="text" id="Name" check-type="required" v-model="Name" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="Code"> 编号 </label>
                <div class="col-sm-9">
                    <input type="text" id="Code" check-type="required" v-model="Code" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="SortNo"> 排序号 </label>
                <div class="col-sm-9">
                    <input type="text" id="SortNo" check-type="required" v-model="SortNo" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="ParentName"> 上级类别</label>
                <div class="col-sm-9">
                    <input id="ParentName" type="text" v-model="ParentName" />
                    <input id="ParentId" type="hidden" v-model="ParentId" />
                    <div id="menuContent" class="menuContent" style="display: none;">
                        <ul id="org" class="ztree"></ul>
                    </div>
                </div>
            </div>

        </form>
    </div>

</div>


<script src="~/BllScripts/grid.js?v=20170825102600"></script>
<script src="~/BllScripts/parentTree.js"></script>
<script src="~/BllScripts/jqEvent.js"></script>
<script src="~/BllScripts/organizeManager.js?v=20170825102600"></script>
